package org.bot.plugin.data.event;

import org.bot.api.event.DataStorage;
import org.bot.api.event.EventName;
import org.bot.api.event.Events;
import org.bot.api.flow.FlowNode;
import org.springframework.stereotype.Component;

/**
 * @author 沧月
 * @create 0028 2023/9/28 17:18
 * @description <判断器>
 */

@Component
@EventName("判断器")
public class DataDeterminer implements Events {
    @Override
    public Object exec(FlowNode note, DataStorage data) {
        if (data.containsKey(note.getDataIndex())) {
            return data.get(note.getDataIndex());
        }
        return false;
    }

}
